<?php

namespace app\index\controller;

use app\common\CommonController;
use app\index\service\EditorService;
use app\index\service\ImportexportService;

class Editor extends CommonController
{
    public function __construct(){
        parent::__construct();
    }

    /**
     * 编辑人员列表
     * @author LSH
     * @return json
     */
    public function getEditorList(){
        $data = EditorService::getEditorListLogic($this->param);
        returnJson(1,'', $data['data'], $data['count']);
    }

    /**
     * 编辑人员修改
     * @author LSH
     * @return json
     */
    public function updateOperatorInfo(){
        $code = EditorService::updateOperatorInfoLogic($this->param);
        $msg = ($code == 0)?'操作失败':'成功';
        returnJson($code,$msg);
    }

    /**
     * sku编辑人员导入
     * @author LSH
     * @return array
     */
    public function uploadSkuEditorInfo(){
        $param = $this->param;
        $param['actionAsync'] = "\app\index\service\EditorService::uploadSkuEditorInfo";
        $result = ImportexportService::importTask($param, 26,2);
        exitJson($result);
    }
}